/*
**************************************************************************************
*Myriad Engine                                                                       *
*Copyright (C) 2006-2007, 5d Studios (www.5d-Studios.com)                            *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
package leola.frontend;

import leola.frontend.tokens.LeolaErrorCode;

/**
 * An exception during parsing
 * 
 * @author Tony
 *
 */
public class ParseException extends Exception {

	/**
	 * SUID
	 */
	private static final long serialVersionUID = 4773494052623080002L;

	/**
	 * Error code
	 */
	private LeolaErrorCode errorCode;
	
	public ParseException() {
		this(LeolaErrorCode.UNKNOWN_ERROR);
	}
	
	/**
	 * @param errorCode
	 */
	public ParseException(LeolaErrorCode errorCode) {
		this.errorCode = errorCode;
	}

	/**
	 * @param message
	 */
	public ParseException(LeolaErrorCode errorCode, String message) {
		super(message);
		this.errorCode = errorCode;
	}

	/**
	 * @param cause
	 */
	public ParseException(LeolaErrorCode errorCode, Throwable cause) {
		super(cause);
		this.errorCode = errorCode;
	}

	/**
	 * @param message
	 * @param cause
	 */
	public ParseException(LeolaErrorCode errorCode, String message, Throwable cause) {
		super(message, cause);
		this.errorCode = errorCode;
	}
	
	/**
	 * @param message
	 */
	public ParseException(String message) {
		this(LeolaErrorCode.UNKNOWN_ERROR, message);		
	}

	/**
	 * @param cause
	 */
	public ParseException(Throwable cause) {
		this(LeolaErrorCode.UNKNOWN_ERROR,cause);
	}

	/**
	 * @param message
	 * @param cause
	 */
	public ParseException(String message, Throwable cause) {
		this(LeolaErrorCode.UNKNOWN_ERROR,message, cause);		
	}

	/**
	 * @return the errorCode
	 */
	public LeolaErrorCode getErrorCode() {
		return errorCode;
	}
}
